import { Plugin } from 'xgplayer'
import type TopPosUIToVueUi from "./TopPosUIToVue.ts.vue";

const { POSITIONS } = Plugin
export default class TopPosUIToVue extends Plugin {
  // 插件的名称，将作为插件实例的唯一key值
  static get pluginName() {
    return 'TopPosUIToVue'
  }

  static get defaultConfig () {
    return {
      // 挂载在controls的右侧，如果不指定则默认挂载在播放器根节点上
      position: POSITIONS.ROOT_TOP
    }
  }

  topPosUIToVueUi: InstanceType<typeof TopPosUIToVueUi> = null;

  constructor (args) {
    super(args)
    this.topPosUIToVueUi = args.config.topPosUIToVueUi
  }

  beforePlayerInit () {
    // TODO 播放器调用start初始化播放源之前的逻辑
  }

  afterPlayerInit () {
    // TODO 播放器调用start初始化播放源之后的逻辑
  }

  afterCreate () {
  }

  destroy () {
  }

  render () {
    return `<div class="controls-autohide"></div>`
  }
}
